package com.jd.financeweb.controller;

import com.alibaba.fastjson.JSON;
import com.jd.financeweb.service.RepayService;
import com.jd.financeweb.service.impl.RepayServiceImpl;
import com.mysql.cj.util.StringUtils;
import lombok.extern.slf4j.Slf4j;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;

@Slf4j
@WebServlet("/getRepayStatus")
public class adminMdCenter extends HttpServlet {
    RepayService repayService = new RepayServiceImpl();
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
    }

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {

        String page = req.getParameter("page");
        String limit = req.getParameter("limit");

        String response;
        response = repayService.getRepayStatus(Integer.parseInt(page),Integer.parseInt(limit));

        resp.setCharacterEncoding("utf-8");
        resp.setContentType("text/html");

        PrintWriter out = resp.getWriter();

        out.println(response);
        out.flush();
        out.close();
    }
}
